<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();
Route::middleware(['auth.admin:admin'])->group(function () {
    Route::get('/', function () {
        return redirect()->route('apply');
    });
});
Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {
    $router->get('/', 'HomeController@index');
    $router->resource('apply', 'AdminApplyController');
    $router->resource('type', 'AdminTypeController');
    $router->resource('level', 'AdminLevelController');
    $router->resource('source', 'AdminSourceController');
    $router->resource('wechat_user', 'AdminWechatUserController');
    $router->post('common/upload', 'UploadController@create');
    $router->post('common/delete', 'UploadController@delete');
    $router->post('common/import', 'ImportController@import');
});
